import React, { Component } from 'react'
import { Route, Switch } from "react-router-dom"
import News from "./home/news"
import Msg from "./home/msg"
import MyNavLink from '../components/MyNavLink'

export default class home extends Component {
    render() {
        return (
            <div>
                <h1>home 页面</h1>
                <div>
                    <button>
                        <MyNavLink to="/home/news">News</MyNavLink>
                    </button>
                    <button>
                        <MyNavLink to="/home/msg">Msg</MyNavLink>
                    </button>
                </div>
                <div>
                    <Switch>
                        <Route path="/home/news" component={News}></Route>
                        <Route path="/home/msg" component={Msg}></Route>
                    </Switch>
                </div>
            </div>
        )
    }
}
